﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Lib.Utils;

namespace MS.INV.Exports.Profits
{
    public class Profit_Chart_Year : ExcelBase
    {
        public Profit_Chart_Year() :
            base(System.Windows.Forms.Application.StartupPath + @"\Rpt Xls\Profit_Chart_Year.xls")
        { 
        }

        public void DoExport(DataTable Data, int Year)
        {
            currSheet.Cells[1, 1] = "Năm " + Year.ToString();

            foreach (DataRow ro in Data.Rows)
            {
                currSheet.Cells[Cvert.ToInt16(ro["Thang"], 0) + 3, 2] = Cvert.ToDecimal(ro["LoiNhuan"], 0);
                currSheet.Cells[Cvert.ToInt16(ro["Thang"], 0) + 3, 3] = Cvert.ToDecimal(ro["DoanhThu"], 0);
            }

            this.Save(System.Windows.Forms.Application.StartupPath + @"\Export Xls\Profit_Chart_Year.xls");
        }
    }
}
